# -*- coding: utf-8 -*-
from abc import ABC
from app.models.dao import vectors, vectorss
from app.views import CommonHandler
from app.models import db_session


class VectorsHandler(CommonHandler, ABC):
    async def get(self):
        meta_id = self.get_argument("meta_id", None)
        data = vectors(meta_id)
        await self.respose(data=data)

    async def post(self):
        params, session = self.json_params(), db_session()
        meta_ids = params['meta_ids']
        data = vectorss(meta_ids)
        await self.respose(data=data)
